<?php

/**
 * Doctor form.
 *
 * @package    form
 * @subpackage Doctor
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $
 */
class DoctorForm extends BaseDoctorForm
{
  protected function initialize(){
    
    $this -> labels = array (
    
                        'especialidad_doctor_id' => 'ID de la Especialidad del Doctor',
                        'dni'                    => 'DNI',
                        'codigo_colegiatura'     => 'Codigo de Colegiatura',
                        'nombres'                => 'Nombres',
                        'apellido_paterno'       => 'Apellido Paterno',
                        'apellido_materno'       => 'Apellido Materno',
                        'fecha_nacimiento'       => 'Fecha de Nacimiento',
                        'sexo'                   => 'sexo',
                        'estado'                 => 'estado',
                      );
  }
  public function configure()
  {
    $months = kcDateTime::generateMonths();
    $days   = kcDateTime::generateDays();
    $years  = kcDateTime::generateYears(1929, null);
    
    $this -> setWidgets(
      
      array (
        'id'                     => new sfWidgetFormInputHidden(),
        'especialidad_doctor_id' => new sfWidgetFormDoctrineSelect(
                                        array (
                                              'model'     => 'EspecialidadDoctor', 
                                              'add_empty' => '---Seleccionar---', 
                                              'order_by'  => array('Nombre', 'asc')
                                        )
                                    ),
        'dni'                    => new sfWidgetFormInput(),
        'codigo_colegiatura'     => new sfWidgetFormInput(),
        'nombres'                => new sfWidgetFormInput(),
        'apellido_paterno'       => new sfWidgetFormInput(),
        'apellido_materno'       => new sfWidgetFormInput(),
        'fecha_nacimiento'       => new sfWidgetFormDate(
                                      array
		                              (
		                                'format' =>'%day%&nbsp;%month%&nbsp;%year%', 
		                                'months' => $months,
		                                'days'   => $days,
		                                'years'  => $years,
		                              )
                                    ),
        'sexo'                   => new sfWidgetFormSelect(array('choices' => $this->getObject()->getTable()->getSexo())),
        'estado'                 => new sfWidgetFormSelect(array('choices' => $this->getObject()->getTable()->getEstado())),
      )
    
    );
    
    $this -> types = array(
      'id'                     => '=',
      'especialidad_doctor_id' => array('combo', array()),
      'dni'                    => 'code',
      'codigo_colegiatura'     => 'code',
      'nombres'                => 'name',
      'apellido_paterno'       => 'name',
      'apellido_materno'       => 'name',
      'fecha_nacimiento'       => 'date',
      'sexo'                   => array('combo', array('choices' => array_keys($this->getObject()->getTable()->getSexo()))),
      'estado'                 => array('combo', array('choices' => array_keys($this->getObject()->getTable()->getEstado()))),
      'slug'                   => '-',
      'created_at'             => '-',
      
    );
  }
}